package com.its.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author huguangjun
 * @className RibbonRule
 * @date 2021/1/9
 * @desc 14:47
 */
@Configuration
public class MySelfRule {

    /**
     * ribbon 随机规则
     * @return
     */
    @Bean
    public IRule myRule(){
        return new RandomRule(); // 定义为随机
    }
}
